﻿using System.Collections.Generic;

namespace AuchanScan.Datas
{
    public class Tract
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public bool IsSpecial { get; set; }
        public string StartDate { get; set; }
        public string EndDate { get; set; }

        public List<Rayon> Rayons { get; set; }

        public string Image
        {
            get { return string.Format("http://mypromos.prod.phoceis.com/ressources/tracts/{0}.jpg", Id); }
        }
    }

    public class Rayon
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public int Order { get; set; }
        public int TractId { get; set; }
        public List<Offre> Offres { get; set; }

        public string Image
        {
            get { return string.Format("http://mypromos.prod.phoceis.com/ressources/rayons/{0}.png", Id); }
        }

        public override string ToString()
        {
            return Name[0].ToString();
        }
    }

    public class Offre
    {
        public Offre()
        {
            NbrNeededForPromo = 1;
            NbrNeededToPay = 1;
        }

        public int NbrNeededForPromo { get; set; }
        public int NbrNeededToPay { get; set; }


        public int Id { get; set; }
        public List<int> RayonIds { get; set; }
        public int PageVL { get; set; }
        public int Position { get; set; }
        public string Nom1 { get; set; }
        public string Nom2 { get; set; }
        public double Price { get; set; }
        public double StrikePrice { get; set; }
        public double EuroCagnotte { get; set; }
        public double EuroPercent { get; set; }
        public string Comment1 { get; set; }
        public string Comment2 { get; set; }
        public string Comment3 { get; set; }
        public string FreeMecanic { get; set; }
        public bool IsComplex { get; set; }
        public int TractId { get; set; }
        public string StartDate { get; set; }
        public string EndDate { get; set; }
        public int Order { get; set; }
        public bool ContainSpecialStuff { get; set; }

        public string Image1
        {
            get { return string.Format("http://mypromos.prod.phoceis.com/ressources/produits/{0}_70x70.jpg", Id); }
        }

        public string Image2
        {
            get { return string.Format("http://mypromos.prod.phoceis.com/ressources/produits/{0}_320x300.jpg", Id); }
        }

        public string Image3
        {
            get { return string.Format("http://mypromos.prod.phoceis.com/ressources/produits/{0}_640x600.jpg", Id); }
        }
    }
}